package com.lening.provider.controller.ComplaintAndAdvice;

import com.lening.common.base.BaseController;
import com.lening.provider.dto.ComplaintAndAdvice.ComplaTypeDTO;
import com.lening.provider.po.ComplaintAndAdvice.ComplaTypePO;
import com.lening.provider.service.ComplaintAndAdvice.ComplaTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 刘政华
 * @datetime 2024/6/4 20:44
 * @description 类对象
 */
@Slf4j
@RestController
@RequestMapping("complaTypes")
public class ComplaTypeController extends BaseController<ComplaTypePO, ComplaTypeDTO, ComplaTypeService> {

    @Resource
    private ComplaTypeService complaTypeService;

    @GetMapping("dropdown")
    public List<ComplaTypeDTO> getComplaTypeList(@RequestParam(name = "complaTypeName", required = false) String complaTypeName){
        List<ComplaTypeDTO> list = complaTypeService.getByName(complaTypeName);
        return list;
    }

}
